Public Class frmSEARCH_ITEM
    Dim Condition As Integer = 2
    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub GridItem_ColumnHeaderClick(ByVal sender As Object, ByVal e As Janus.Windows.GridEX.ColumnActionEventArgs) Handles GridItem.ColumnHeaderClick
        Select Case e.Column.Key
            Case "ITEM_CODE"
                Condition = 1
            Case "ITEM_NAME"
                Condition = 2
            Case "BARCODE"
                Condition = 3
        End Select
        Search()
    End Sub
    Private Sub Search()
        If txtParameter.Text <> "" Then
            Dim arName As New ArrayList
            arName.Add("@Condition")
            arName.Add("@Parameter")
            Dim arVal As New ArrayList
            arVal.Add(Condition)
            arVal.Add(txtParameter.Text)
            GridItem.DataSource = BLL.ObjectGetBy("ITEM_SEARCH", arName, arVal)
        End If
    End Sub

    Private Sub txtParameter_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtParameter.TextChanged
        Search()
    End Sub

    Private Sub Keyboardcontrol1_UserKeyPressed(ByVal sender As System.Object, ByVal e As VINAPOS.KeyboardClassLibrarySmall.KeyboardEventArgs) Handles Keyboardcontrol1.UserKeyPressed
        txtParameter.Focus()
        SendKeys.Send(e.KeyboardKeyPressed)
    End Sub

    Private Sub frmSEARCH_ITEM_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Try
            GC.Collect()
            Me.Dispose()
        Catch ex As Exception

        End Try
    End Sub

    Private Sub frmSEARCH_ITEM_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        PublicFunction.NewFormLoad(Me)
        Me.GridItem.RootTable.Columns("PRICE_VAT").FormatString = PublicVariable.NumberFormatString
        Me.GridItem.RootTable.Columns("STOCK").FormatString = PublicVariable.NumberFormatString
    End Sub
End Class